home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
pascal
/
tpref.exe
/
SOURCE.EXE
/
DEMORECU.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1992-08-07
|
399b
|
25 lines
{ DEMORECU.PAS }
program DemoRecursion;
function Factorial ( n : real ) : real;
begin
if n = 1 then
Factorial := 1
else
Factorial := N * Factorial ( N - 1.0 );
end;
var
X : Real;
begin
Write('Enter a number: ');
Readln( X );
Writeln;
Writeln('Factorial of ',X,' = ', Factorial ( X ) );
Writeln;
Write('Press Enter to finish.');
Readln;
end.